package com.cardone.platform.configuration.service;

import java.util.List;
import java.util.Map;

import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

import com.cardone.common.cache.support.CacheEvictSupport;
import com.cardone.common.dto.PaginationDto;
import com.cardone.common.cache.Caches;
import com.cardone.platform.configuration.dto.DictionaryItemDto;

/**
 * 字典项服务
 *
 * @author yaohaitao
 */
public interface DictionaryItemService {
	/**
	 * spring bean id
	 */
	String BEAN_ID = "com.cardone.platform.configuration.service.DictionaryItemService";

	/**
	 * 保存:字典项
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param saveDictionaryItem
	 *            字典项对象
	 * 
	 * @return 字典项对象
	 */
	@Deprecated
	@CacheEvict(value = DictionaryItemService.BEAN_ID, allEntries = true)
	<P> P saveByIdOrCode(Class<P> mappedClass, DictionaryItemDto saveDictionaryItem);

	/**
	 * 保存:字典项
	 * 
	 * @param saveDictionaryItem
	 *            字典项对象
	 * 
	 * @return 字典项对象
	 */
	@Deprecated
	@CacheEvict(value = DictionaryItemService.BEAN_ID, allEntries = true)
	DictionaryItemDto saveByIdOrCode(DictionaryItemDto saveDictionaryItem);

	/**
	 * 插入
	 * 
	 * @param insertDictionaryItem
	 *            字典项对象
	 * 
	 * @return 影响行数
	 */
	@Deprecated
	@CacheEvict(value = DictionaryItemService.BEAN_ID, allEntries = true)
	int insertByCode(DictionaryItemDto insertDictionaryItem);
	
	/**
	 * 删除
	 * 
	 * @param deleteDictionaryItem
	 *            字典项对象
	 * 
	 * @return 影响行数
	 */
	@Deprecated
	@CacheEvict(value = DictionaryItemService.BEAN_ID, allEntries = true)
	int deleteByIds(DictionaryItemDto deleteDictionaryItem);

	/**
	 * 更新
	 * 
	 * @param updateDictionaryItem
	 *            字典项对象
	 * 
	 * @return 影响行数
	 */
	@Deprecated
	@CacheEvict(value = DictionaryItemService.BEAN_ID, allEntries = true)
	int updateByCode(DictionaryItemDto updateDictionaryItem);

	/**
	 * 查询
	 * 
	 * @param requiredType
	 *            返回类型
	 * 
	 * @param readDictionaryItem
	 *            字典项对象
	 * @return 返回数据
	 */
	@Deprecated
	@Cacheable(value = DictionaryItemService.BEAN_ID, key = Caches.KEY_1)
	Integer readByCodeNqIdForCount(DictionaryItemDto readDictionaryItem);
	
	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param findDictionaryItem
	 *            字典项对象
	 * @return 返回对象
	 */
	@Deprecated
	@Cacheable(value = DictionaryItemService.BEAN_ID, key = Caches.KEY_2)
	<P> P findById(Class<P> mappedClass, DictionaryItemDto findDictionaryItem);

	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param findDictionaryItem
	 *            字典项对象
	 * 
	 * @return 返回对象
	 */
	@Deprecated
	@Cacheable(value = DictionaryItemService.BEAN_ID, key = Caches.KEY_2)
	<P> P findByCodeOrId(Class<P> mappedClass, DictionaryItemDto findDictionaryItem);

	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param findListDictionaryItem
	 *            字典项对象
	 * 
	 * @return 字典项对象集合
	 */
	@Deprecated
	@Cacheable(value = DictionaryItemService.BEAN_ID, key = Caches.KEY_2)
	<P> List<P> findListByLikeCode(Class<P> mappedClass, DictionaryItemDto findListDictionaryItem);

	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @return 字典项对象集合
	 */
	@Deprecated
	@Cacheable(value = DictionaryItemService.BEAN_ID, key = Caches.KEY_1)
	<P> List<P> findList(Class<P> mappedClass);

	/**
	 * 分页
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param paginationDictionaryItem
	 *            字典项对象
	 * 
	 * @return 字典项分页对象
	 */
	@Deprecated
	@Cacheable(value = DictionaryItemService.BEAN_ID, key = Caches.KEY_2)
	<P> PaginationDto<P> paginationByLikeCode(Class<P> mappedClass, DictionaryItemDto paginationDictionaryItem);
}